home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / othergnu / atari-~1.zoo / atari-groff.diff next >
Encoding:
Text File  |  1992-05-10  |  35.6 KB  |  1,236 lines

  1. diff -rc2N groff-1.05/Makefile groff-1.05.atari/Makefile
  2. *** groff-1.05/Makefile    Sat May  9 15:42:02 1992
  3. --- groff-1.05.atari/Makefile    Sat May  9 22:48:08 1992
  4. ***************
  5. *** 1,5 ****
  6.   #Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
  7.   #     Written by James Clark (jjc@jclark.com)
  8. - #
  9.   #This file is part of groff.
  10.   #
  11. --- 1,4 ----
  12. ***************
  13. *** 123,130 ****
  14.   
  15.   # Uncomment the next line if you have vfork().
  16. ! D2=#-DHAVE_VFORK
  17.   
  18.   # Uncomment the next line if you have sys_siglist[].
  19. ! D3=#-DHAVE_SYS_SIGLIST
  20.   
  21.   # Uncomment the next line if you have the mmap() system call (and you
  22. --- 122,129 ----
  23.   
  24.   # Uncomment the next line if you have vfork().
  25. ! D2=-DHAVE_VFORK
  26.   
  27.   # Uncomment the next line if you have sys_siglist[].
  28. ! D3=-DHAVE_SYS_SIGLIST
  29.   
  30.   # Uncomment the next line if you have the mmap() system call (and you
  31. ***************
  32. *** 133,137 ****
  33.   
  34.   # Uncomment the next line if you have the rename() system call.
  35. ! D5=#-DHAVE_RENAME
  36.   
  37.   # Uncomment the next line if the argument to localtime() is a long*
  38. --- 132,136 ----
  39.   
  40.   # Uncomment the next line if you have the rename() system call.
  41. ! D5=-DHAVE_RENAME
  42.   
  43.   # Uncomment the next line if the argument to localtime() is a long*
  44. ***************
  45. *** 141,145 ****
  46.   # Uncomment the next line if wait is declared by your C++ header files
  47.   # to take an argument of type union wait *.
  48. ! D7=#-DHAVE_UNION_WAIT
  49.   
  50.   # Uncoment the next line if your C++ header files declare a type pid_t
  51. --- 140,144 ----
  52.   # Uncomment the next line if wait is declared by your C++ header files
  53.   # to take an argument of type union wait *.
  54. ! D7=-DHAVE_UNION_WAIT
  55.   
  56.   # Uncoment the next line if your C++ header files declare a type pid_t
  57. ***************
  58. *** 155,159 ****
  59.   # Uncomment the next line if <sys/wait.h> should not be included
  60.   # when using wait().  Use this with the libg++ header files.
  61. ! D10=-DNO_SYS_WAIT_H
  62.   
  63.   # Uncomment the next line if you C++ compiler requires delete [n] rather
  64. --- 154,158 ----
  65.   # Uncomment the next line if <sys/wait.h> should not be included
  66.   # when using wait().  Use this with the libg++ header files.
  67. ! D10=#-DNO_SYS_WAIT_H
  68.   
  69.   # Uncomment the next line if you C++ compiler requires delete [n] rather
  70. ***************
  71. *** 185,189 ****
  72.   # MALLOCFLAGS=-DUSG
  73.   # Use this with SunOS 4.1 and 4.1.1.
  74. ! MALLOCFLAGS=-DBSD -DSUNOS_LOCALTIME_BUG
  75.   
  76.   # Comment this out if the GNU malloc gives you problems, or if you would
  77. --- 184,189 ----
  78.   # MALLOCFLAGS=-DUSG
  79.   # Use this with SunOS 4.1 and 4.1.1.
  80. ! #MALLOCFLAGS=-DBSD -DSUNOS_LOCALTIME_BUG
  81. ! MALLOCFLAGS=-DBSD
  82.   
  83.   # Comment this out if the GNU malloc gives you problems, or if you would
  84. ***************
  85. *** 211,217 ****
  86.   
  87.   # CC is the C++ compiler
  88. ! CC=g++
  89.   # This is the flag that tells the C++ compiler to treat a .c file as C++.
  90. ! C++LANG_FLAG=
  91.   # I'm told that -fno-inline is needed on a 68030-based Apollo
  92.   # CC=g++ -fno-inline
  93. --- 211,217 ----
  94.   
  95.   # CC is the C++ compiler
  96. ! # CC=g++
  97.   # This is the flag that tells the C++ compiler to treat a .c file as C++.
  98. ! # C++LANG_FLAG=
  99.   # I'm told that -fno-inline is needed on a 68030-based Apollo
  100.   # CC=g++ -fno-inline
  101. ***************
  102. *** 218,223 ****
  103.   
  104.   # Use this with gcc/g++ version 2.
  105. ! # CC=gcc
  106. ! # C++LANG_FLAG=-xc++
  107.   
  108.   # OLDCC is the C compiler.
  109. --- 218,223 ----
  110.   
  111.   # Use this with gcc/g++ version 2.
  112. ! CC=gcc
  113. ! C++LANG_FLAG=-xc++
  114.   
  115.   # OLDCC is the C compiler.
  116. ***************
  117. *** 225,231 ****
  118.   
  119.   PROFILE_FLAG=
  120. ! DEBUG_FLAG=-g
  121.   # With gcc/g++ 2.0 on a sparc, -O works better than -O2.
  122. ! OPTIMIZE_FLAG=-O
  123.   WARNING_FLAGS=#-Wall -Wcast-qual -Wwrite-strings
  124.   
  125. --- 225,232 ----
  126.   
  127.   PROFILE_FLAG=
  128. ! DEBUG_FLAG=
  129.   # With gcc/g++ 2.0 on a sparc, -O works better than -O2.
  130. ! #OPTIMIZE_FLAG=-O
  131. ! OPTIMIZE_FLAG=-O2
  132.   WARNING_FLAGS=#-Wall -Wcast-qual -Wwrite-strings
  133.   
  134. ***************
  135. *** 245,253 ****
  136.   LDFLAGS=$(PROFILE_FLAG) $(DEBUG_FLAG) $(XLDFLAGS)
  137.   # Libraries needed for linking C++ programs.
  138. ! LIBS=
  139.   # Libraries needed for linking C++ programs that use libm.a.
  140. ! MLIBS=$(LIBS) -lm
  141.   
  142. ! AR=ar
  143.   
  144.   # Define RANLIB to be empty if you don't have ranlib.
  145. --- 246,255 ----
  146.   LDFLAGS=$(PROFILE_FLAG) $(DEBUG_FLAG) $(XLDFLAGS)
  147.   # Libraries needed for linking C++ programs.
  148. ! LIBS=-lg++
  149.   # Libraries needed for linking C++ programs that use libm.a.
  150. ! #MLIBS=$(LIBS) -lm
  151. ! MLIBS=$(LIBS) 
  152.   
  153. ! AR=gcc-ar
  154.   
  155.   # Define RANLIB to be empty if you don't have ranlib.
  156. Binary files groff-1.05/gendef and groff-1.05.atari/gendef differ
  157. diff -rc2N groff-1.05/groff.c groff-1.05.atari/groff.c
  158. *** groff-1.05/groff.c    Wed Oct 30 12:12:48 1991
  159. --- groff-1.05.atari/groff.c    Sat May  9 22:24:26 1992
  160. ***************
  161. *** 45,50 ****
  162.   #else
  163.   typedef int PID_T;
  164. ! #endif
  165.   #ifdef HAVE_UNION_WAIT
  166.   typedef union wait WAIT_STATUS_T;
  167. --- 45,49 ----
  168.   #else
  169.   typedef int PID_T;
  170. ! #endif // HAVE_PID_T
  171.   #ifdef HAVE_UNION_WAIT
  172.   typedef union wait WAIT_STATUS_T;
  173. diff -rc2N groff-1.05/lib/Makefile groff-1.05.atari/lib/Makefile
  174. *** groff-1.05/lib/Makefile    Thu Aug 22 12:32:00 1991
  175. --- groff-1.05.atari/lib/Makefile    Sat May  9 20:24:40 1992
  176. ***************
  177. *** 34,38 ****
  178.       ptable.o font.o fontfile.o nametoindex.o filename.o lineno.o \
  179.       progname.o lf.o change_lf.o version.o tmpfile.o \
  180. !     $(FMOD) $(STRTOL) $(GETCWD)
  181.   SOURCES=new.c itoa.c strerror.c error.c errarg.c fatal.c prime.c \
  182.       strsave.c matherr.c fmod.c assert.c iftoa.c tmpfile.c getcwd.c \
  183. --- 34,39 ----
  184.       ptable.o font.o fontfile.o nametoindex.o filename.o lineno.o \
  185.       progname.o lf.o change_lf.o version.o tmpfile.o \
  186. !     $(FMOD) $(STRTOL) $(GETCWD) getopt.o getopt1.o
  187.   SOURCES=new.c itoa.c strerror.c error.c errarg.c fatal.c prime.c \
  188.       strsave.c matherr.c fmod.c assert.c iftoa.c tmpfile.c getcwd.c \
  189. ***************
  190. *** 39,42 ****
  191. --- 40,44 ----
  192.           string.c cset.c cmap.c ptable.c font.c fontfile.c nametoindex.c \
  193.           filename.c lineno.c progname.c lf.c change_lf.c version.c \
  194. +     getopt.c getopt1.o getopt.h \
  195.       assert.h cset.h cmap.h errarg.h error.h font.h getpagesize.h \
  196.       lib.h ptable.h stringclass.h
  197. ***************
  198. *** 55,58 ****
  199. --- 57,66 ----
  200.       @echo const char \*version_string = \"`cat ../VERSION`\"\; >$@
  201.   
  202. + getopt.o: getopt.c getopt.h
  203. +     $(OLDCC) $(OLDCFLAGS) -c getopt.c
  204. + getopt1.o: getopt1.c getopt.h
  205. +     $(OLDCC) $(OLDCFLAGS) -c getopt1.c
  206.   malloc.o: malloc.c getpagesize.h
  207.       $(OLDCC) $(OLDCFLAGS) $(MALLOCFLAGS) -c malloc.c
  208. ***************
  209. *** 84,88 ****
  210.   tmpfile.o: lib.h errarg.h error.h
  211.   
  212. ! fontpath.h: FORCE
  213.       @$(SHELL) ../gendef $@ "FONTPATH=\"$(FONTPATH)\""
  214.   
  215. --- 92,98 ----
  216.   tmpfile.o: lib.h errarg.h error.h
  217.   
  218. ! #fontpath.h: FORCE
  219. ! #    @$(SHELL) ../gendef $@ "FONTPATH=\"$(FONTPATH)\""
  220. ! fontpath.h: 
  221.       @$(SHELL) ../gendef $@ "FONTPATH=\"$(FONTPATH)\""
  222.   
  223. diff -rc2N groff-1.05/lib/getopt.c groff-1.05.atari/lib/getopt.c
  224. *** groff-1.05/lib/getopt.c
  225. --- groff-1.05.atari/lib/getopt.c    Sat May  9 19:25:24 1992
  226. ***************
  227. *** 0 ****
  228. --- 1,595 ----
  229. + /* Getopt for GNU.
  230. +    Copyright (C) 1987, 1989, 1990 Free Software Foundation, Inc.
  231. + This program is free software; you can redistribute it and/or modify
  232. + it under the terms of the GNU General Public License as published by
  233. + the Free Software Foundation; either version 2 of the License, or
  234. + (at your option) any later version.
  235. + This program is distributed in the hope that it will be useful,
  236. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  237. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  238. + GNU General Public License for more details.
  239. + You should have received a copy of the GNU General Public License
  240. + along with this program; if not, write to the Free Software
  241. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  242. + #ifdef __STDC__
  243. + #define CONST const
  244. + #else
  245. + #define CONST
  246. + #endif
  247. + /* This version of `getopt' appears to the caller like standard Unix `getopt'
  248. +    but it behaves differently for the user, since it allows the user
  249. +    to intersperse the options with the other arguments.
  250. +    As `getopt' works, it permutes the elements of `argv' so that,
  251. +    when it is done, all the options precede everything else.  Thus
  252. +    all application programs are extended to handle flexible argument order.
  253. +    Setting the environment variable _POSIX_OPTION_ORDER disables permutation.
  254. +    Then the behavior is completely standard.
  255. +    GNU application programs can use a third alternative mode in which
  256. +    they can distinguish the relative order of options and other arguments.  */
  257. + #include <stdio.h>
  258. + /* If compiled with GNU C, use the built-in alloca */
  259. + #ifdef __GNUC__
  260. + #define alloca __builtin_alloca
  261. + #else /* not __GNUC__ */
  262. + #ifdef sparc
  263. + #include <alloca.h>
  264. + #else
  265. + char *alloca ();
  266. + #endif
  267. + #endif /* not __GNUC__ */
  268. + #if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__)
  269. + #include <stdlib.h>
  270. + #include <string.h>
  271. + #define bcopy(s, d, n) memcpy ((d), (s), (n))
  272. + #define index strchr
  273. + #else
  274. + #ifdef USG
  275. + #include <string.h>
  276. + #define bcopy(s, d, n) memcpy ((d), (s), (n))
  277. + #define index strchr
  278. + #else
  279. + #ifdef VMS
  280. + #include <string.h>
  281. + #else
  282. + #include <strings.h>
  283. + #endif
  284. + void bcopy ();
  285. + #endif
  286. + char *getenv ();
  287. + char *malloc ();
  288. + #endif
  289. + /* For communication from `getopt' to the caller.
  290. +    When `getopt' finds an option that takes an argument,
  291. +    the argument value is returned here.
  292. +    Also, when `ordering' is RETURN_IN_ORDER,
  293. +    each non-option ARGV-element is returned here.  */
  294. + char *optarg = 0;
  295. + /* Index in ARGV of the next element to be scanned.
  296. +    This is used for communication to and from the caller
  297. +    and for communication between successive calls to `getopt'.
  298. +    On entry to `getopt', zero means this is the first call; initialize.
  299. +    When `getopt' returns EOF, this is the index of the first of the
  300. +    non-option elements that the caller should itself scan.
  301. +    Otherwise, `optind' communicates from one call to the next
  302. +    how much of ARGV has been scanned so far.  */
  303. + int optind = 0;
  304. + /* The next char to be scanned in the option-element
  305. +    in which the last option character we returned was found.
  306. +    This allows us to pick up the scan where we left off.
  307. +    If this is zero, or a null string, it means resume the scan
  308. +    by advancing to the next ARGV-element.  */
  309. + static char *nextchar;
  310. + /* Callers store zero here to inhibit the error message
  311. +    for unrecognized options.  */
  312. + int opterr = 1;
  313. + /* Describe how to deal with options that follow non-option ARGV-elements.
  314. +    If the caller did not specify anything,
  315. +    the default is REQUIRE_ORDER if the environment variable
  316. +    _POSIX_OPTION_ORDER is defined, PERMUTE otherwise.
  317. +    REQUIRE_ORDER means don't recognize them as options;
  318. +    stop option processing when the first non-option is seen.
  319. +    This is what Unix does.
  320. +    This mode of operation is selected by either setting the environment
  321. +    variable _POSIX_OPTION_ORDER, or using `+' as the first character
  322. +    of the list of option characters.
  323. +    PERMUTE is the default.  We permute the contents of ARGV as we scan,
  324. +    so that eventually all the non-options are at the end.  This allows options
  325. +    to be given in any order, even with programs that were not written to
  326. +    expect this.
  327. +    RETURN_IN_ORDER is an option available to programs that were written
  328. +    to expect options and other ARGV-elements in any order and that care about
  329. +    the ordering of the two.  We describe each non-option ARGV-element
  330. +    as if it were the argument of an option with character code 1.
  331. +    Using `-' as the first character of the list of option characters
  332. +    selects this mode of operation.
  333. +    The special argument `--' forces an end of option-scanning regardless
  334. +    of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
  335. +    `--' can cause `getopt' to return EOF with `optind' != ARGC.  */
  336. + static enum
  337. + {
  338. +   REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
  339. + } ordering;
  340. + /* Describe the long-named options requested by the application.
  341. +    _GETOPT_LONG_OPTIONS is a vector of `struct option' terminated by an
  342. +    element containing a name which is zero.
  343. +    The field `has_arg' is 1 if the option takes an argument,
  344. +    2 if it takes an optional argument.  */
  345. + struct option
  346. + {
  347. +   char *name;
  348. +   int has_arg;
  349. +   int *flag;
  350. +   int val;
  351. + };
  352. + CONST struct option *_getopt_long_options;
  353. + int _getopt_long_only = 0;
  354. + /* Index in _GETOPT_LONG_OPTIONS of the long-named option actually found.
  355. +    Only valid when a long-named option was found. */
  356. + int option_index;
  357. + /* Handle permutation of arguments.  */
  358. + /* Describe the part of ARGV that contains non-options that have
  359. +    been skipped.  `first_nonopt' is the index in ARGV of the first of them;
  360. +    `last_nonopt' is the index after the last of them.  */
  361. + static int first_nonopt;
  362. + static int last_nonopt;
  363. + /* Exchange two adjacent subsequences of ARGV.
  364. +    One subsequence is elements [first_nonopt,last_nonopt)
  365. +     which contains all the non-options that have been skipped so far.
  366. +    The other is elements [last_nonopt,optind), which contains all
  367. +     the options processed since those non-options were skipped.
  368. +    `first_nonopt' and `last_nonopt' are relocated so that they describe
  369. +     the new indices of the non-options in ARGV after they are moved.  */
  370. + static void
  371. + exchange (argv)
  372. +      char **argv;
  373. + {
  374. +   int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *);
  375. +   char **temp = (char **) alloca (nonopts_size);
  376. +   /* Interchange the two blocks of data in ARGV.  */
  377. +   bcopy (&argv[first_nonopt], temp, nonopts_size);
  378. +   bcopy (&argv[last_nonopt], &argv[first_nonopt],
  379. +      (optind - last_nonopt) * sizeof (char *));
  380. +   bcopy (temp, &argv[first_nonopt + optind - last_nonopt], nonopts_size);
  381. +   /* Update records for the slots the non-options now occupy.  */
  382. +   first_nonopt += (optind - last_nonopt);
  383. +   last_nonopt = optind;
  384. + }
  385. + /* Scan elements of ARGV (whose length is ARGC) for option characters
  386. +    given in OPTSTRING.
  387. +    If an element of ARGV starts with '-', and is not exactly "-" or "--",
  388. +    then it is an option element.  The characters of this element
  389. +    (aside from the initial '-') are option characters.  If `getopt'
  390. +    is called repeatedly, it returns successively each of the option characters
  391. +    from each of the option elements.
  392. +    If `getopt' finds another option character, it returns that character,
  393. +    updating `optind' and `nextchar' so that the next call to `getopt' can
  394. +    resume the scan with the following option character or ARGV-element.
  395. +    If there are no more option characters, `getopt' returns `EOF'.
  396. +    Then `optind' is the index in ARGV of the first ARGV-element
  397. +    that is not an option.  (The ARGV-elements have been permuted
  398. +    so that those that are not options now come last.)
  399. +    OPTSTRING is a string containing the legitimate option characters.
  400. +    If an option character is seen that is not listed in OPTSTRING,
  401. +    return '?' after printing an error message.  If you set `opterr' to
  402. +    zero, the error message is suppressed but we still return '?'.
  403. +    If a char in OPTSTRING is followed by a colon, that means it wants an arg,
  404. +    so the following text in the same ARGV-element, or the text of the following
  405. +    ARGV-element, is returned in `optarg'.  Two colons mean an option that
  406. +    wants an optional arg; if there is text in the current ARGV-element,
  407. +    it is returned in `optarg', otherwise `optarg' is set to zero.
  408. +    If OPTSTRING starts with `-' or `+', it requests different methods of
  409. +    handling the non-option ARGV-elements.
  410. +    See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
  411. +    Long-named options begin with `+' instead of `-'.
  412. +    Their names may be abbreviated as long as the abbreviation is unique
  413. +    or is an exact match for some defined option.  If they have an
  414. +    argument, it follows the option name in the same ARGV-element, separated
  415. +    from the option name by a `=', or else the in next ARGV-element.
  416. +    When `getopt' finds a long-named option, it returns 0 if that option's
  417. +    `flag' field is nonzero, the value of the option's `val' field
  418. +    otherwise.  */
  419. + int
  420. + getopt (argc, argv, optstring)
  421. +      int argc;
  422. +      char **argv;
  423. +      CONST char *optstring;
  424. + {
  425. +   optarg = 0;
  426. +   /* Initialize the internal data when the first call is made.
  427. +      Start processing options with ARGV-element 1 (since ARGV-element 0
  428. +      is the program name); the sequence of previously skipped
  429. +      non-option ARGV-elements is empty.  */
  430. +   if (optind == 0)
  431. +     {
  432. +       first_nonopt = last_nonopt = optind = 1;
  433. +       nextchar = 0;
  434. +       /* Determine how to handle the ordering of options and nonoptions.  */
  435. +       if (optstring[0] == '-')
  436. +     {
  437. +       ordering = RETURN_IN_ORDER;
  438. +       ++optstring;
  439. +     }
  440. +       else if (optstring[0] == '+')
  441. +     {
  442. +       ordering = REQUIRE_ORDER;
  443. +       ++optstring;
  444. +     }
  445. +       else if (getenv ("_POSIX_OPTION_ORDER") != 0)
  446. +     ordering = REQUIRE_ORDER;
  447. +       else
  448. +     ordering = PERMUTE;
  449. +     }
  450. +   if (nextchar == 0 || *nextchar == 0)
  451. +     {
  452. +       if (ordering == PERMUTE)
  453. +     {
  454. +       /* If we have just processed some options following some non-options,
  455. +          exchange them so that the options come first.  */
  456. +       if (first_nonopt != last_nonopt && last_nonopt != optind)
  457. +         exchange (argv);
  458. +       else if (last_nonopt != optind)
  459. +         first_nonopt = optind;
  460. +       /* Now skip any additional non-options
  461. +          and extend the range of non-options previously skipped.  */
  462. +       while (optind < argc
  463. +          && (argv[optind][0] != '-'
  464. +              || argv[optind][1] == 0)
  465. +          && (_getopt_long_options == 0
  466. +              || argv[optind][0] != '+'
  467. +              || argv[optind][1] == 0))
  468. +         optind++;
  469. +       last_nonopt = optind;
  470. +     }
  471. +       /* Special ARGV-element `--' means premature end of options.
  472. +      Skip it like a null option,
  473. +      then exchange with previous non-options as if it were an option,
  474. +      then skip everything else like a non-option.  */
  475. +       if (optind != argc && !strcmp (argv[optind], "--"))
  476. +     {
  477. +       optind++;
  478. +       if (first_nonopt != last_nonopt && last_nonopt != optind)
  479. +         exchange (argv);
  480. +       else if (first_nonopt == last_nonopt)
  481. +         first_nonopt = optind;
  482. +       last_nonopt = argc;
  483. +       optind = argc;
  484. +     }
  485. +       /* If we have done all the ARGV-elements, stop the scan
  486. +      and back over any non-options that we skipped and permuted.  */
  487. +       if (optind == argc)
  488. +     {
  489. +       /* Set the next-arg-index to point at the non-options
  490. +          that we previously skipped, so the caller will digest them.  */
  491. +       if (first_nonopt != last_nonopt)
  492. +         optind = first_nonopt;
  493. +       return EOF;
  494. +     }
  495. +       /* If we have come to a non-option and did not permute it,
  496. +      either stop the scan or describe it to the caller and pass it by.  */
  497. +       if ((argv[optind][0] != '-' || argv[optind][1] == 0)
  498. +       && (_getopt_long_options == 0
  499. +           || argv[optind][0] != '+' || argv[optind][1] == 0))
  500. +     {
  501. +       if (ordering == REQUIRE_ORDER)
  502. +         return EOF;
  503. +       optarg = argv[optind++];
  504. +       return 1;
  505. +     }
  506. +       /* We have found another option-ARGV-element.
  507. +      Start decoding its characters.  */
  508. +       nextchar = argv[optind] + 1;
  509. +     }
  510. +   if (_getopt_long_options != 0
  511. +       && (argv[optind][0] == '+'
  512. +       || (_getopt_long_only && argv[optind][0] == '-'))
  513. +     )
  514. +     {
  515. +       CONST struct option *p;
  516. +       char *s = nextchar;
  517. +       int exact = 0;
  518. +       int ambig = 0;
  519. +       CONST struct option *pfound = 0;
  520. +       int indfound;
  521. +       while (*s && *s != '=')
  522. +     s++;
  523. +       /* Test all options for either exact match or abbreviated matches.  */
  524. +       for (p = _getopt_long_options, option_index = 0; p->name;
  525. +        p++, option_index++)
  526. +     if (!strncmp (p->name, nextchar, s - nextchar))
  527. +       {
  528. +         if (s - nextchar == strlen (p->name))
  529. +           {
  530. +         /* Exact match found.  */
  531. +         pfound = p;
  532. +         indfound = option_index;
  533. +         exact = 1;
  534. +         break;
  535. +           }
  536. +         else if (pfound == 0)
  537. +           {
  538. +         /* First nonexact match found.  */
  539. +         pfound = p;
  540. +         indfound = option_index;
  541. +           }
  542. +         else
  543. +           /* Second nonexact match found.  */
  544. +           ambig = 1;
  545. +       }
  546. +       if (ambig && !exact)
  547. +     {
  548. +       fprintf (stderr, "%s: option `%s' is ambiguous\n",
  549. +            argv[0], argv[optind]);
  550. +       nextchar += strlen (nextchar);
  551. +       optind++;
  552. +       return '?';
  553. +     }
  554. +       if (pfound != 0)
  555. +     {
  556. +       option_index = indfound;
  557. +       optind++;
  558. +       if (*s)
  559. +         {
  560. +           if (pfound->has_arg > 0)
  561. +         optarg = s + 1;
  562. +           else
  563. +         {
  564. +           fprintf (stderr,
  565. +                "%s: option `%c%s' doesn't allow an argument\n",
  566. +                argv[0], argv[optind - 1][0], pfound->name);
  567. +           nextchar += strlen (nextchar);
  568. +           return '?';
  569. +         }
  570. +         }
  571. +       else if (pfound->has_arg == 1)
  572. +         {
  573. +           if (optind < argc)
  574. +         optarg = argv[optind++];
  575. +           else
  576. +         {
  577. +           fprintf (stderr, "%s: option `%s' requires an argument\n",
  578. +                argv[0], argv[optind - 1]);
  579. +           nextchar += strlen (nextchar);
  580. +           return '?';
  581. +         }
  582. +         }
  583. +       nextchar += strlen (nextchar);
  584. +       if (pfound->flag)
  585. +         {
  586. +           *(pfound->flag) = pfound->val;
  587. +           return 0;
  588. +         }
  589. +       return pfound->val;
  590. +     }
  591. +       /* Can't find it as a long option.  If this is getopt_long_only,
  592. +      and the option starts with '-' and is a valid short
  593. +      option, then interpret it as a short option.  Otherwise it's
  594. +      an error.  */
  595. +       if (_getopt_long_only == 0 || argv[optind][0] == '+' ||
  596. +       index (optstring, *nextchar) == 0)
  597. +     {
  598. +       if (opterr != 0)
  599. +         fprintf (stderr, "%s: unrecognized option `%c%s'\n",
  600. +              argv[0], argv[optind][0], nextchar);
  601. +       nextchar += strlen (nextchar);
  602. +       optind++;
  603. +       return '?';
  604. +     }
  605. +     }
  606. +   /* Look at and handle the next option-character.  */
  607. +   {
  608. +     char c = *nextchar++;
  609. +     char *temp = index (optstring, c);
  610. +     /* Increment `optind' when we start to process its last character.  */
  611. +     if (*nextchar == 0)
  612. +       optind++;
  613. +     if (temp == 0 || c == ':')
  614. +       {
  615. +     if (opterr != 0)
  616. +       {
  617. +         if (c < 040 || c >= 0177)
  618. +           fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
  619. +                argv[0], c);
  620. +         else
  621. +           fprintf (stderr, "%s: unrecognized option `-%c'\n",
  622. +                argv[0], c);
  623. +       }
  624. +     return '?';
  625. +       }
  626. +     if (temp[1] == ':')
  627. +       {
  628. +     if (temp[2] == ':')
  629. +       {
  630. +         /* This is an option that accepts an argument optionally.  */
  631. +         if (*nextchar != 0)
  632. +           {
  633. +         optarg = nextchar;
  634. +         optind++;
  635. +           }
  636. +         else
  637. +           optarg = 0;
  638. +         nextchar = 0;
  639. +       }
  640. +     else
  641. +       {
  642. +         /* This is an option that requires an argument.  */
  643. +         if (*nextchar != 0)
  644. +           {
  645. +         optarg = nextchar;
  646. +         /* If we end this ARGV-element by taking the rest as an arg,
  647. +            we must advance to the next element now.  */
  648. +         optind++;
  649. +           }
  650. +         else if (optind == argc)
  651. +           {
  652. +         if (opterr != 0)
  653. +           fprintf (stderr, "%s: option `-%c' requires an argument\n",
  654. +                argv[0], c);
  655. +         c = '?';
  656. +           }
  657. +         else
  658. +           /* We already incremented `optind' once;
  659. +          increment it again when taking next ARGV-elt as argument.  */
  660. +           optarg = argv[optind++];
  661. +         nextchar = 0;
  662. +       }
  663. +       }
  664. +     return c;
  665. +   }
  666. + }
  667. + #ifdef TEST
  668. + /* Compile with -DTEST to make an executable for use in testing
  669. +    the above definition of `getopt'.  */
  670. + int
  671. + main (argc, argv)
  672. +      int argc;
  673. +      char **argv;
  674. + {
  675. +   int c;
  676. +   int digit_optind = 0;
  677. +   while (1)
  678. +     {
  679. +       int this_option_optind = optind ? optind : 1;
  680. +       c = getopt (argc, argv, "abc:d:0123456789");
  681. +       if (c == EOF)
  682. +     break;
  683. +       switch (c)
  684. +     {
  685. +     case '0':
  686. +     case '1':
  687. +     case '2':
  688. +     case '3':
  689. +     case '4':
  690. +     case '5':
  691. +     case '6':
  692. +     case '7':
  693. +     case '8':
  694. +     case '9':
  695. +       if (digit_optind != 0 && digit_optind != this_option_optind)
  696. +         printf ("digits occur in two different argv-elements.\n");
  697. +       digit_optind = this_option_optind;
  698. +       printf ("option %c\n", c);
  699. +       break;
  700. +     case 'a':
  701. +       printf ("option a\n");
  702. +       break;
  703. +     case 'b':
  704. +       printf ("option b\n");
  705. +       break;
  706. +     case 'c':
  707. +       printf ("option c with value `%s'\n", optarg);
  708. +       break;
  709. +     case '?':
  710. +       break;
  711. +     default:
  712. +       printf ("?? getopt returned character code 0%o ??\n", c);
  713. +     }
  714. +     }
  715. +   if (optind < argc)
  716. +     {
  717. +       printf ("non-option ARGV-elements: ");
  718. +       while (optind < argc)
  719. +     printf ("%s ", argv[optind++]);
  720. +       printf ("\n");
  721. +     }
  722. +   exit (0);
  723. + }
  724. + #endif /* TEST */
  725. diff -rc2N groff-1.05/lib/getopt.h groff-1.05.atari/lib/getopt.h
  726. *** groff-1.05/lib/getopt.h
  727. --- groff-1.05.atari/lib/getopt.h    Sat May  9 20:42:54 1992
  728. ***************
  729. *** 0 ****
  730. --- 1,121 ----
  731. + /* declarations for getopt -- command-line argument scanning subroutine
  732. +    Copyright 1989-1991  Free Software Foundation, Inc.
  733. + This program is free software; you can redistribute it and/or modify
  734. + it under the terms of the GNU General Public License as published by
  735. + the Free Software Foundation; either version 2 of the License, or
  736. + (at your option) any later version.
  737. + This program is distributed in the hope that it will be useful,
  738. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  739. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  740. + GNU General Public License for more details.
  741. + You should have received a copy of the GNU General Public License
  742. + along with this proggram; if not, write to the Free Software
  743. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  744. + /* For communication from `getopt' to the caller.
  745. +    When `getopt' finds an option that takes an argument,
  746. +    the argument value is returned here.
  747. +    Also, when `ordering' is RETURN_IN_ORDER,
  748. +    each non-option ARGV-element is returned here.  */
  749. + #ifndef __GETOPT_H
  750. + #define __GETOPT_H
  751. + #ifdef __cplusplus
  752. + extern "C" {
  753. + #endif
  754. + extern char *optarg;
  755. + /* Index in ARGV of the next element to be scanned.
  756. +    This is used for communication to and from the caller
  757. +    and for communication between successive calls to `getopt'.
  758. +    On entry to `getopt', zero means this is the first call; initialize.
  759. +    When `getopt' returns EOF, this is the index of the first of the
  760. +    non-option elements that the caller should itself scan.
  761. +    Otherwise, `optind' communicates from one call to the next
  762. +    how much of ARGV has been scanned so far.  */
  763. + extern int optind;
  764. + /* Callers store zero here to inhibit the error message `getopt' prints
  765. +    for unrecognized options.  */
  766. + extern int opterr;
  767. + /* Describe the long-named options requested by the application.
  768. +    _GETOPT_LONG_OPTIONS is a vector of `struct option' terminated by an
  769. +    element containing a name which is zero.
  770. +    The field `has_arg' is:
  771. +    0 if the option does not take an argument,
  772. +    1 if the option requires an argument,
  773. +    2 if the option takes an optional argument.
  774. +    The type getopt_long_has_arg defines these values below.
  775. +    If the field `flag' is nonzero, it points to a variable that is set
  776. +    to the value given in the field `val' when the option is found, but
  777. +    left unchanged if the option is not found.
  778. +    To have a long-named option do something other than set an `int' to
  779. +    a compiled-in constant, such as set a value from `optarg', set the
  780. +    option's `flag' field to zero and its `val' field to a nonzero
  781. +    value (the equivalent single-letter option character, if there is
  782. +    one).  For long options that have a zero `flag' field, `getopt'
  783. +    returns the contents of the `val' field.  */
  784. + enum getopt_long_has_arg {
  785. +     GETOPT_NO_ARG = 0,
  786. +     GETOPT_REQ_ARG = 1,
  787. +     GETOPT_OPT_ARG = 2
  788. + };
  789. + struct option
  790. + {
  791. +   char *name;
  792. +   int has_arg;
  793. +   int *flag;
  794. +   int val;
  795. + };
  796. + #ifdef __STDC__
  797. + extern const struct option *_getopt_long_options;
  798. + #else
  799. + extern struct option *_getopt_long_options;
  800. + #endif
  801. + /* If nonzero, '-' can introduce long-named options.
  802. +    Set by getopt_long_only.  */
  803. + extern int _getopt_long_only;
  804. + /* The index in GETOPT_LONG_OPTIONS of the long-named option found.
  805. +    Only valid when a long-named option has been found by the most
  806. +    recent call to `getopt'.  */
  807. + extern int option_index;
  808. + #ifdef __STDC__
  809. + int getopt (int argc, char **argv, const char *shortopts);
  810. + int getopt_long (int argc, char **argv, const char *shortopts,
  811. +          const struct option *longopts, int *longind);
  812. + int getopt_long_only (int argc, char **argv, const char *shortopts,
  813. +               const struct option *longopts, int *longind);
  814. + void envopt(int *pargc, char ***pargv, char *optstr);
  815. + #else
  816. + int getopt ();
  817. + int getopt_long ();
  818. + int getopt_long_only ();
  819. + void envopt();
  820. + #endif
  821. + #ifdef __cplusplus
  822. + }
  823. + #endif
  824. + #endif                /* __GETOPT_H */
  825. diff -rc2N groff-1.05/lib/getopt1.c groff-1.05.atari/lib/getopt1.c
  826. *** groff-1.05/lib/getopt1.c
  827. --- groff-1.05.atari/lib/getopt1.c    Sat May  9 19:25:26 1992
  828. ***************
  829. *** 0 ****
  830. --- 1,160 ----
  831. + /* Getopt for GNU.
  832. +    Copyright (C) 1987, 1989 Free Software Foundation, Inc.
  833. + This program is free software; you can redistribute it and/or modify
  834. + it under the terms of the GNU General Public License as published by
  835. + the Free Software Foundation; either version 2 of the License, or
  836. + (at your option) any later version.
  837. + This program is distributed in the hope that it will be useful,
  838. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  839. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  840. + GNU General Public License for more details.
  841. + You should have received a copy of the GNU General Public License
  842. + along with this program; if not, write to the Free Software
  843. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  844. + #include "getopt.h"
  845. + #ifdef __STDC__
  846. + #define CONST const
  847. + #else
  848. + #define CONST
  849. + #endif
  850. + #if !defined (NULL)
  851. + #define NULL 0
  852. + #endif
  853. + int
  854. + getopt_long (argc, argv, options, long_options, opt_index)
  855. +      int argc;
  856. +      char **argv;
  857. +      CONST char *options;
  858. +      CONST struct option *long_options;
  859. +      int *opt_index;
  860. + {
  861. +   int val;
  862. +   _getopt_long_options = long_options;
  863. +   val = getopt (argc, argv, options);
  864. +   if (val == 0 && opt_index != NULL)
  865. +     *opt_index = option_index;
  866. +   return val;
  867. + }
  868. + /* Like getopt_long, but '-' as well as '+' can indicate a long option.
  869. +    If an option that starts with '-' doesn't match a long option,
  870. +    but does match a short option, it is parsed as a short option
  871. +    instead. */
  872. + int 
  873. + getopt_long_only (argc, argv, options, long_options, opt_index)
  874. +      int argc;
  875. +      char **argv;
  876. +      CONST char *options;
  877. +      CONST struct option *long_options;
  878. +      int *opt_index;
  879. + {
  880. +   int val;
  881. +   _getopt_long_options = long_options;
  882. +   _getopt_long_only = 1;
  883. +   val = getopt (argc, argv, options);
  884. +   if (val == 0 && opt_index != NULL)
  885. +     *opt_index = option_index;
  886. +   return val;
  887. + }
  888. + #ifdef TEST
  889. + #include <stdio.h>
  890. + int
  891. + main (argc, argv)
  892. +      int argc;
  893. +      char **argv;
  894. + {
  895. +   int c;
  896. +   int digit_optind = 0;
  897. +   while (1)
  898. +     {
  899. +       int this_option_optind = optind ? optind : 1;
  900. +       char *name = '\0';
  901. +       int option_index = 0;
  902. +       static struct option long_options[] =
  903. +       {
  904. +     {"add", 1, 0, 0},
  905. +     {"append", 0, 0, 0},
  906. +     {"delete", 1, 0, 0},
  907. +     {"verbose", 0, 0, 0},
  908. +     {"create", 0, 0, 0},
  909. +     {"file", 1, 0, 0},
  910. +     {0, 0, 0, 0}
  911. +       };
  912. +       c = getopt_long (argc, argv, "abc:d:0123456789",
  913. +                long_options, &option_index);
  914. +       if (c == EOF)
  915. +     break;
  916. +       switch (c)
  917. +     {
  918. +     case 0:
  919. +       printf ("option %s", (long_options[option_index]).name);
  920. +       if (optarg)
  921. +         printf (" with arg %s", optarg);
  922. +       printf ("\n");
  923. +       break;
  924. +     case '0':
  925. +     case '1':
  926. +     case '2':
  927. +     case '3':
  928. +     case '4':
  929. +     case '5':
  930. +     case '6':
  931. +     case '7':
  932. +     case '8':
  933. +     case '9':
  934. +       if (digit_optind != 0 && digit_optind != this_option_optind)
  935. +         printf ("digits occur in two different argv-elements.\n");
  936. +       digit_optind = this_option_optind;
  937. +       printf ("option %c\n", c);
  938. +       break;
  939. +     case 'a':
  940. +       printf ("option a\n");
  941. +       break;
  942. +     case 'b':
  943. +       printf ("option b\n");
  944. +       break;
  945. +     case 'c':
  946. +       printf ("option c with value `%s'\n", optarg);
  947. +       break;
  948. +     case '?':
  949. +       break;
  950. +     default:
  951. +       printf ("?? getopt returned character code 0%o ??\n", c);
  952. +     }
  953. +     }
  954. +   if (optind < argc)
  955. +     {
  956. +       printf ("non-option ARGV-elements: ");
  957. +       while (optind < argc)
  958. +     printf ("%s ", argv[optind++]);
  959. +       printf ("\n");
  960. +     }
  961. +   exit (0);
  962. + }
  963. + #endif /* TEST */
  964. diff -rc2N groff-1.05/lib/getpagesize.h groff-1.05.atari/lib/getpagesize.h
  965. *** groff-1.05/lib/getpagesize.h    Wed Feb 21 01:35:42 1990
  966. --- groff-1.05.atari/lib/getpagesize.h    Sat May  9 19:06:48 1992
  967. ***************
  968. *** 1,2 ****
  969. --- 1,5 ----
  970. + #ifdef atarist
  971. + #define getpagesize() 4096
  972. + #else
  973.   #ifdef BSD
  974.   #ifndef BSD4_1
  975. ***************
  976. *** 21,25 ****
  977.   #endif /* no NBPG */
  978.   #endif /* no EXEC_PAGESIZE */
  979.   #endif /* not HAVE_GETPAGESIZE */
  980. --- 24,27 ----
  981.   #endif /* no NBPG */
  982.   #endif /* no EXEC_PAGESIZE */
  983.   #endif /* not HAVE_GETPAGESIZE */
  984. ! #endif /* atarist */
  985. diff -rc2N groff-1.05/lib/lib.h groff-1.05.atari/lib/lib.h
  986. *** groff-1.05/lib/lib.h    Sat May  9 15:43:04 1992
  987. --- groff-1.05.atari/lib/lib.h    Sat May  9 20:26:20 1992
  988. ***************
  989. *** 32,35 ****
  990. --- 32,38 ----
  991.   int is_prime(unsigned);
  992.   #include <stdio.h>
  993. + #ifdef atarist
  994. + #include "getopt.h"
  995. + #endif
  996.   FILE *xtmpfile();
  997.   
  998. diff -rc2N groff-1.05/lib/strerror.c groff-1.05.atari/lib/strerror.c
  999. *** groff-1.05/lib/strerror.c    Sat Jan 19 10:59:24 1991
  1000. --- groff-1.05.atari/lib/strerror.c    Sat May  9 19:04:24 1992
  1001. ***************
  1002. *** 1,2 ****
  1003. --- 1,3 ----
  1004. + #ifndef atarist
  1005.   /* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
  1006.        Written by James Clark (jjc@jclark.uucp)
  1007. ***************
  1008. *** 34,35 ****
  1009. --- 35,37 ----
  1010.     }
  1011.   }
  1012. + #endif atarist
  1013. diff -rc2N groff-1.05/pic/mkpictab groff-1.05.atari/pic/mkpictab
  1014. *** groff-1.05/pic/mkpictab
  1015. --- groff-1.05.atari/pic/mkpictab    Sat May  9 23:21:28 1992
  1016. ***************
  1017. *** 0 ****
  1018. --- 1 ----
  1019. + gcc -c -I../lib -xc++ -O2 -DHAVE_VFORK -DHAVE_SYS_SIGLIST -DHAVE_RENAME -DHAVE_UNION_WAIT -DWAIT_COREDUMP_0200 pic.tab.c
  1020. diff -rc2N groff-1.05/pic/pic.y groff-1.05.atari/pic/pic.y
  1021. *** groff-1.05/pic/pic.y    Sat May  9 15:45:24 1992
  1022. --- groff-1.05.atari/pic/pic.y    Sat May  9 19:15:56 1992
  1023. ***************
  1024. *** 31,34 ****
  1025. --- 31,35 ----
  1026.   extern void do_lookahead();
  1027.   
  1028. + #if !defined(_M68881) && !defined(__M68881)
  1029.   extern "C" {
  1030.     double fmod(double, double);
  1031. ***************
  1032. *** 35,38 ****
  1033. --- 36,40 ----
  1034.     int rand();
  1035.   }
  1036. + #endif
  1037.   
  1038.   /* Maximum number of characters produced by printf("%g") */
  1039. diff -rc2N groff-1.05/ps/Makefile groff-1.05.atari/ps/Makefile
  1040. *** groff-1.05/ps/Makefile    Sat May  9 15:45:26 1992
  1041. --- groff-1.05.atari/ps/Makefile    Sat May  9 21:33:28 1992
  1042. ***************
  1043. *** 55,59 ****
  1044.         ../lib/stringclass.h ../lib/cset.h
  1045.   
  1046. ! broken.h: FORCE
  1047.       @$(SHELL) ../gendef $@ "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)"
  1048.   
  1049. --- 55,62 ----
  1050.         ../lib/stringclass.h ../lib/cset.h
  1051.   
  1052. ! #broken.h: FORCE
  1053. ! #    @$(SHELL) ../gendef $@ "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)"
  1054. ! broken.h: 
  1055.       @$(SHELL) ../gendef $@ "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)"
  1056.   
  1057. diff -rc2N groff-1.05/refer/indxbib.c groff-1.05.atari/refer/indxbib.c
  1058. *** groff-1.05/refer/indxbib.c    Sat May  9 15:45:50 1992
  1059. --- groff-1.05.atari/refer/indxbib.c    Sat May  9 21:25:54 1992
  1060. ***************
  1061. *** 206,212 ****
  1062. --- 206,218 ----
  1063.     if (!mktemp(temp_index_file) || !temp_index_file[0])
  1064.       fatal("cannot create file name for temporary file");
  1065. + #ifndef atarist
  1066.     signal(SIGHUP, fatal_signal);
  1067.     signal(SIGINT, fatal_signal);
  1068.     signal(SIGTERM, fatal_signal);
  1069. + #else
  1070. +   signal(SIGHUP, (__Sigfunc) fatal_signal);
  1071. +   signal(SIGINT, (__Sigfunc) fatal_signal);
  1072. +   signal(SIGTERM,(__Sigfunc) fatal_signal);
  1073. + #endif  
  1074.     int fd = creat(temp_index_file, 0444);
  1075.     if (fd < 0)
  1076.